package ms.maplestory.boot.enums;

import java.util.Arrays;

/**
 * 装备前缀类型
 */
public enum EquipPrefixType {

    Cap(100),
    FaceAccessory(101),
    EyeAccessory(102),
    Earrings(103),
    Coat(104),
    LongCoat(105),
    Pants(106),
    Shoes(107),
    Glove(108),
    Shield(109),
    Cape(110),
    Ring(111),
    Pendant(112),
    Belt(113),
    Medal(114),
    Shoulder(115),
    OneHandedSword(130),
    OneHandedAxe(131),
    OneHandedBluntWeapon(132),
    Dagger(133),
    TwoHandedKnife(134),
    Wand(137),
    Staff(138),
    TwoHandedSword(140),
    TwoHandedAxe(141),
    TwoHandedBluntWeapon(142),
    Spear(143),
    PoleArm(144),
    Bow(145),
    Crossbow(146),
    Claw(147),
    Knuckle(148),
    Gun(149),
    SkillEffect(160),
    MachineEngine(161),
    MachineArm(162),
    MachineLeg(163),
    MachineFrame(164),
    MachineTransistor(165),
    PetEquip(180),
    PetSkill(181),
    PetRing1(182),
    PetRing2(183),
    TamingMob(190),
    Saddle(191),
    DragonCap(194),
    DragonPendant(195),
    DragonWing(196),
    DragonShoes(197);

    private int value;

    EquipPrefixType(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static EquipPrefixType getByValue(int prefix) {
        return Arrays.stream(values())
                .filter(ep -> ep.getValue() == prefix).findAny().orElse(null);
    }
}
